home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_01_bab_cine4_old.cog < prev    next >
Text File  |  1999-11-15  |  27KB  |  817 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 01_BAB_Cinematic_4.cog
  4. #
  5. # Kazakstan Exposition with Indy & Turner ends Babylon Chapter
  6. #
  7. # [HB]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15.     # ************************ MESSAGES ************************
  16.  
  17.     message        startup
  18.     message     crossed
  19.     message        entered
  20.     message        activated
  21.     message        callback
  22.     message        shutdown
  23.     message        timer
  24.     
  25.     # ************************ KEYFRAMES ***********************
  26.     
  27.     keyframe    in_PushHat=0in_figithat_4_4.key            local
  28.     keyframe    in_ArmsOut=0in_armsout_1_1.key            local
  29.     keyframe    in_Gesture=0in_armsup_1_1.key            local
  30.     keyframe    in_Think=0in_thinking_4_4.key            local
  31.     keyframe    in_leftarm=0in_leftarm_1_1.key            local
  32.     
  33.     keyframe    in_handsSide=0in_stand1.key                local
  34.     keyframe    in_armsCrossed=0in_stand2.key            local
  35.     keyframe    in_handsOnHips=0in_stand4.key            local
  36.     keyframe    in_crossArms=0in_stand1_bd_2.key           local
  37.     keyframe    in_handsToHips=0in_stand1_bd_4.key           local
  38.     keyframe    in_handsToSide=0in_stand4_bd_1.key           local
  39.     keyframe    in_showMarduk=0in_holdstatue_1_hold.key    local
  40.     keyframe    in_giveMarduk=0in_givestatue_hold_1.key    local
  41.     keyframe    in_inscription=0in_inscription_1_1.key    local
  42.     keyframe    in_urgon=0in_urgon_1_1.key                local
  43.     keyframe    in_heavenly=0in_tianshan_1_1.key        local
  44.     keyframe    in_Smash=0in_smash_1_4.key                local
  45.     
  46.     keyframe    jpa_mountJeep=ij_sitdown.key            local
  47.     keyframe    jpa_steerL=ij_turnL.key                    local
  48.     keyframe    jpa_steerR=ij_turnR.key                    local
  49.     keyframe    jpa_wheelsFwd=ij_wheelturn.key            local
  50.     
  51.     keyframe    trn_handships=0tu_stand1.key            local
  52.     keyframe    trn_armsFold=0tu_stand2.key                local
  53.     keyframe    trn_handsSide=0tu_stand3.key            local
  54.     keyframe    trn_handstohips=0tu_stand3_bd_1.key        local
  55.     keyframe    trn_lounge=0tu_stand6.key                local
  56.     keyframe    trn_tenhut=0tu_stand6_bd_1.key            local
  57.     keyframe    trn_fistshake=0tu_pointout_1_1.key        local
  58.     keyframe    trn_givekey=0tu_hndkey_1_1.key            local
  59.     keyframe    trn_beMyGuest=0tu_funeral_3_2.key        local
  60.     keyframe    trn_foldArms=0tu_stand1_bd_2.key        local
  61.     keyframe    trn_leftUp=0tu_leftarm_1_1.key            local
  62.     keyframe    trn_nothelp=0tu_nothelp_1_1.key            local
  63.     keyframe    trn_reach=0tu_reach_1_1.key                local
  64.     keyframe    trn_getMarduk=0tu_takestatue_1_hold.key    local
  65.     keyframe    trn_stowMarduk=0tu_putawaystatue_hold_1.key        local
  66.     keyframe    trn_sovietland=0tu_lasttime_1_1.key        local
  67.     
  68.     keyframe    jeep_idle=ij_idle.key                   local
  69.     keyframe    jeep_fwd_rev=ij_fwd_bd_rev.key          local
  70.     keyframe    jeep_rev_fwd=ij_rev_bd_fwd.key          local
  71.     keyframe    jeep_turnleft=ij_turnL.key              local
  72.     keyframe    jeep_turnright=ij_turnR.key             local
  73.     keyframe    jeep_rturnleft=ij_rev_turnL.key         local
  74.     keyframe    jeep_rturnright=ij_rev_turnR.key        local
  75.     keyframe    jeep_runforward=ij_fwd.key              local
  76.     keyframe    jeep_runbackward=ij_rev.key             local
  77.        
  78.     # ************************* MODELS *************************
  79.         
  80.     model          mod_in=gen_in_shirt.3do                    local
  81.     model        mod_trn=gen_tu.3do                        local
  82.     model       inhand_mdkstat=hand_in_mrdkstat.3do     local
  83.     model       tuhand_mdkstat=hand_tu_mrdkstat.3do     local
  84.     model       tu_hand=hand_in.3do                     local
  85.  
  86.     # ************************* SOUNDS *************************
  87.     
  88.     sound        trn_GotStatue=Bb11t01.wav                local
  89.     sound        in_NotYet=Bb11j02.wav                    local
  90.     sound        trn_HelpEachOther=Bb11t03.wav            local
  91.     sound        trn_WhereStatue=Bb11t04.wav                local
  92.     sound        in_WorkOnIt=bb11j05.wav                    local
  93.     sound        trn_BeWaiting=Bb11t06.wav                local
  94.     sound        trn_StatueJones=Bb11t12.wav                local
  95.     sound        in_YeahIKnow=Bb11j08.wav                local
  96.     sound        trn_StillWaiting=Bb11t09.wav            local
  97.     sound        in_ThisDo=Bb11j13.wav                    local
  98.     sound        trn_JustMight=Bb11t14.wav                local
  99.     sound        in_TowerExpo=Bb11j15.wav                local
  100.     sound        trn_DisciplesWhere=Bb11t16.wav            local
  101.     sound        in_NotSure=Bb11j17.wav                    local
  102.     sound        trn_NotMuch=Bb11t18.wav                    local
  103.     sound        in_Enough=Bb11j19.wav                    local
  104.     sound        trn_KazakSoviet=Bb11t20.wav                local
  105.     sound        in_NoPassport=Bb11j21.wav                local
  106.     sound        trn_YourFuneral=Bb11t22.wav                local
  107.  
  108.     sound       itsawrap=mus_gen_indy_a_theme1.wav      local
  109.     
  110.     sound       jeep_start_wav=jep_engine_start.WAV     local
  111.     sound       jeep_rev_wav=jep_reverse_loop.WAV       local
  112.     sound       jeep_shift_wav=jep_sus_crk_4.WAV        local
  113.     sound       jeep_fwd_wav=jep_engine_loop.WAV        local
  114.            
  115.     # ************************* THINGS *************************
  116.  
  117.     thing        player                                    local
  118.                             
  119.     thing        indy                                    linkid=0
  120.     thing        turner                                    linkid=1
  121.     thing        indyAlt                                    linkid=2
  122.                                                 
  123.     thing        in_mark_2                                  nolink
  124.     thing        in_mark_3                                nolink
  125.  
  126.     thing        trn_mark_2                                nolink
  127.     thing        trn_mark_3                                nolink
  128.     
  129.     thing        cam_1                                    nolink
  130.     thing        cam_2                                    nolink
  131.     thing        cam_3                                    nolink
  132.     thing        cam_4                                    nolink
  133.     thing        cam_5                                    nolink
  134.     thing        cam_6                                    nolink
  135.     thing        cam_7                                    nolink
  136.     thing        cam_8                                    nolink
  137.     thing        cam_9                                    nolink
  138.     thing        cam_10                                    nolink
  139.     
  140.     thing        c_t1                                    nolink
  141.     thing        c_t2                                    nolink
  142.     thing        c_t3                                     nolink
  143.     thing        c_t4                                    nolink
  144.     thing        c_t5                                    nolink
  145.     thing        c_t6                                    nolink
  146.     thing        c_t7                                    nolink
  147.     thing        c_t8                                    nolink
  148.     thing        c_t9                                    nolink
  149.     thing        c_t10                                    nolink
  150.  
  151.     thing        jeep                                    nolink
  152.     
  153.     thing        jp_t1                                    nolink
  154.     thing        jp_t2                                    nolink
  155.     thing        jp_t3                                    nolink
  156.     thing        jp_t4                                    nolink
  157.     thing        jp_t5                                    nolink
  158.     thing        jp_t6                                    nolink
  159.     thing        jp_t7                                    nolink
  160.     thing        jp_t8                                    nolink
  161.  
  162.     thing        jp_lk1                                    nolink
  163.     thing        jp_lk2                                    nolink
  164.     thing        jp_lk3                                    nolink
  165.     thing        jp_lk4                                    nolink
  166.     
  167.     thing       fadeplane
  168.                        
  169.     # *********************** MISCELLANY ***********************
  170.             
  171.     sector        trigger                                 linkid=3
  172.     surface     triggerturner                           
  173.  
  174.     template    jeep_actor_tpl=jeep_actor_pyr            local
  175.  
  176.     vector        camPos                                    local
  177.     vector        interpCamPos                            local
  178.     vector        interpCamLook                            local
  179.     vector        indyHeadAim                                local
  180.     
  181.     flex        turnerCollSize                            local
  182.     flex        turnerMass                                local
  183.     flex        in_rotRate                                local
  184.     flex        trn_rotRate                                local
  185.     flex        jeep_rotRate                            local
  186.     flex        giveidolandexit                         local
  187.                             
  188.     int            in_keyTrack1                            local
  189.     int            in_keyTrack2                            local
  190.  
  191.     int            trn_keyTrack1                            local
  192.     int            trn_keyTrack2                            local
  193.         
  194.     int            in_ArmTrack                                local
  195.     int            trn_ArmTrack                            local
  196.             
  197.     int            in_swap=0                                local
  198.     int            trn_swap=0                                local
  199.                         
  200.     int            sender                                    local
  201.     int            curSound                                local
  202.     int            curCam                                    local
  203.  
  204.     int            cutSceneState=0                            local
  205.  
  206.     int            matAnimNum                                local
  207.     int            actorMeshNum                            local
  208.     int            actorSwapRef                            local
  209.     int            turnerCollType                            local
  210.     int         crosflag = 0                            local
  211.     
  212.     int            mardukIdol=83                            local # inventory bin
  213.     int            tempIdol=0                                local # for test only
  214.     
  215.     int         jeepstart_chan                          local
  216.     int         jeeprevrs_chan                          local
  217.     int         jeepshift_chan                          local
  218.     int         in_jeepkey_rev                          local
  219.     
  220.     thing       jeep_actor                              local       
  221.     
  222. end
  223.  
  224. # ===================================================================
  225.  
  226. code
  227.  
  228. # -------------------------------------------------------------------
  229.  
  230. startup:
  231.  
  232.     # Pointer to Player
  233.     player = GetLocalPlayerThing();
  234.  
  235.     # TO DO:  in real game, actor Turner must already be lounging in place!
  236.     
  237.     turnerCollSize = GetThingCollideSize(turner);
  238.     turnerCollType = GetCollideType(turner);
  239.     turnerMass = GetThingMass(turner);
  240.     trn_rotRate = GetThingMaxRotVel(turner);
  241. //    AISetMode(turner, 0x2000); # turn off his AI
  242.     AISetCutsceneMode(turner);
  243.     trn_keyTrack1 = PlayKey(turner, trn_lounge, 2, 0x10, 0); # lean against jeep
  244.     
  245.     ThingFadeAnim(fadeplane, 1, 0, 0.01, 0);
  246.  
  247.     return;
  248.  
  249. # -------------------------------------------------------------------
  250. crossed:
  251.     if ((GetSenderRef() == triggerturner) && (crosflag == 0) && (GetSourceRef() == player))
  252.     {
  253.         crosflag = 1;
  254.         ClearThingFlags(turner, 0x80000);
  255.         cutSceneState = 1;
  256.     }
  257. return;
  258. # -------------------------------------------------------------------
  259.  
  260. entered:
  261.  
  262.     # NOTE:  this cog only responds to "entered" the first time
  263.     # Indy encounters Turner in this area of Babylon
  264.     
  265.     if ((GetSenderRef() == trigger) && (cutSceneState == 1))
  266. //    if (GetSenderRef() == trigger)
  267.     {
  268.         cutSceneState = 2; # only play the full version one time
  269.         
  270.         RestoreExtCam(); # temp devo stuff
  271.         Sleep(0.01); # temp devo stuff
  272.         
  273.         curCam = GetCurrentCamera();
  274.         
  275.         StartCutscene(1);
  276.         
  277.         # Mood music!
  278.         # PlaySong(5, 5, 5);
  279.         
  280.         # Disable and hide player...
  281.         StopThing(player); # right now
  282.         DeselectWeaponWait(player);
  283.         SetThingFlags(player, 0x80000);
  284.         
  285.         # Prep actor indy...
  286.         CopyPlayerHolsters(player, indy);
  287.         ClearThingFlags(indy, 0x80000); # our actor
  288.         in_rotRate = GetThingMaxRotVel(indy);
  289.         SetThingMaxRotVel(indy, 350.0);
  290.         
  291.         # Prep camera...
  292.         SetCameraLookInterp(2, 0); # kill pan & tilt mode
  293.         SetCameraPosInterp(2, 0); # kill dolly mode
  294.          
  295.         # Walk Indy...
  296.         AISetMoveSpeed(indy, 1.0);
  297.         AISetLookThing(indy, turner);
  298.         AISetMoveThing(indy, in_mark_2, 0);
  299.         Sleep(0.01);
  300.         
  301.         # Cut to watch him...
  302.         SetCameraFocus(2, cam_1);
  303.         SetCameraSecondaryFocus(2, c_t1);
  304.         SetCurrentCamera(2);
  305.         SetCameraFOV(70, 0, 0.0);
  306.         Sleep(0.01);
  307.         
  308.         # Dolly back to frame Turner and jeep...
  309.         SetCameraLookInterp(2, 1); # enable pan & tilt
  310.         SetCameraPosInterp(2, 1); # enable dolly
  311.         SetCameraInterpSpeed(2, 2.0); # speed is actually time (was 3.0)
  312.         Sleep(0.01);
  313.         SetCameraFocus(2, cam_2);
  314.         SetCameraSecondaryFocus(2, c_t2);
  315.         SetCameraFOV(60, 1, 2.0);
  316.         AIWaitForStop(indy);
  317.         
  318.         # Turner:  "Ahh, Jones, there you are..."
  319.         curSound = PlaySoundLocal(trn_GotStatue, 1.0, 0.0, 0x0, 0);
  320.         
  321.         # Turner steps over...
  322.         AISetLookThing(turner, indy);
  323.         AISetLookThing(indy, turner);
  324.         Sleep(0.01);
  325.         StopKey(turner, trn_keyTrack1, 0.0); # stop playing the lounge
  326.         PlayKey(turner, trn_tenhut, 4, 0x12, 1); # stand turner up
  327.         trn_keyTrack1 = PlayKey(turner, trn_handships, 2, 0x10, 0);
  328. //        AIClearMode(turner, 0x2000); # now start turner's watch-indy AI 
  329.         AIClearCutSceneMode(turner);
  330.         AISetLookThing(turner, indy);
  331.         AISetLookThing(indy, turner);
  332.         Sleep(0.4);
  333.         PlayKey(turner, trn_leftUp, 4, 0x12, 1);
  334.         WaitForSound(curSound);
  335.         
  336.         # Establish forthcoming talk radius & nail Turner to this spot...
  337.         SetThingCollideSize(turner, 0.04);    # doubled, so talk distance will be right later
  338.         SetThingMass(turner, 0); # 0 = infinite...don't let player push turner around!
  339.         
  340.         if (GetInv(player, mardukIdol) == 1 && cutSceneState != 3)
  341.         {
  342.             # If Indy has the Marduk statue, complete the scene right now...
  343.             call GiveIdolAndExit;
  344.         }
  345.         
  346.         if (GetInv(player, mardukIdol) == 0 && cutSceneState != 3)
  347.         {
  348.             # If Indy doesn't have the statue, the scene stalls...
  349.             
  350.             # Cut to close-up of Indy...
  351.             SetCameraLookInterp(2, 0); # kill pan & tilt mode
  352.             SetCameraPosInterp(2, 0); # kill dolly mode
  353.             SetCameraFocus(2, cam_3);
  354.             SetCameraSecondaryFocus(2, c_t3);
  355.             SetCameraFOV(38, 0, 0.0);
  356.             Sleep(0.01);
  357.             
  358.             # Indy: "Sorry, not yet..."
  359.             in_keyTrack1 = PlayKey(indy, in_handsOnHips, 2, 0x14, 0);
  360.             PlayKey(indy, in_handsToHips, 4, 0x12, 1);
  361.             PlayKey(indy, in_PushHat, 4, 0x12, 0);
  362.             # curSound = PlaySoundLocal(in_NotYet, 1.0, 0.0, 0x0, 0);
  363.             curSound = PlayVoice(indy, in_NotYet, 1.0, 0);
  364.             Sleep(1.7);
  365.             WaitForSound(curSound);
  366.             StopKey(indy, in_keyTrack1, 0.0);
  367.             
  368.             # Move player into new position before we need him...
  369.             CopyOrientAndPos(indy, player); # plant the player where actor is standing
  370.             StopThing(player); # and calm him down
  371.             ResetThing(player); 
  372.             
  373.             # Cut to close-up of Turner...
  374.             SetCameraFocus(2, cam_4);
  375.             SetCameraSecondaryFocus(2, c_t4);
  376.             SetCameraFOV(45, 0, 0.0); # was 40
  377.             SetThingFlags(indy, 0x10); # invisible
  378.         
  379.             # Turner: "And here I thought..."
  380.             curSound = PlaySoundLocal(trn_HelpEachOther, 1.0, 0.0, 0x0, 0);
  381.             Sleep(0.01);
  382.             trn_keyTrack2 = PlayKey(turner, trn_givekey, 4, 0x12, 0);
  383.             Sleep(4.0);
  384.             PlayKey(turner, trn_fistshake, 4, 0x12, 0);
  385.             WaitForSound(curSound);
  386.             Sleep(0.4);
  387.         
  388.             # Clean up...
  389.             SetCameraLookInterp(2, 0); # kill pan & tilt mode
  390.             SetCameraPosInterp(2, 0); # kill dolly mode
  391.             
  392.             # restore player control...
  393.             SetThingFlags(indy, 0x80010); # hide actor
  394.             camPos = GetThingPOS(cam_1); 
  395.             SetCameraPosition(1, camPos); # prep to swing back to follow-cam
  396.             ClearThingFlags(player, 0x80000); # player active
  397.             SetCurrentCamera(curCam);
  398.             ResetCameraFOV(0, 0.0);
  399.         
  400.         }
  401.         
  402.         EndCutScene();
  403.     }
  404.     return;
  405.  
  406. # -------------------------------------------------------------------
  407.     
  408. activated:
  409.  
  410.     # NOTE:  this cog responds when player activates Turner...
  411.  
  412.     if (GetSenderRef() != turner)
  413.     {
  414.         return;
  415.     }
  416.  
  417.     # set up...
  418.     StartCutscene(1);
  419.     CopyPlayerHolsters(player, indyAlt);
  420.     CopyOrientAndPos(player, indyAlt); # plant dupe actor indy at player location
  421.     SetThingFlags(player, 0x80000); # set player invisible
  422.     ClearThingFlags(indyAlt, 0x80000); # show dupe actor indy
  423.     Sleep(0.01);
  424.     AISetLookThing(indyAlt, turner);
  425.     AISetLookThing(turner, indyAlt);
  426.     
  427.     if (GetInv(player, mardukIdol) == 1)
  428.     //if (tempIdol == 1) # temp test method
  429.     {
  430.         # 83 is item ID for "statuette of winged god Marduk"
  431.         # If Indy has the statue, complete the level right now...
  432.         # TO DO: fix CamLookOffset interp bug
  433.         
  434.         # SetExtCamLookOffset('0.0 0.04 0.014'); # look between indyAlt & turner
  435.         SetExtCamOffset('0.16 0.02 0.055'); # interp cam out to right & a tad high
  436.         Sleep(0.5);
  437.  
  438.         # Turner asks about statue again...
  439.         if (cutSceneState == 1)
  440.         {
  441.             curSound = PlaySoundLocal(trn_WhereStatue, 1.0, 0.0, 0x0, 0);
  442.         }
  443.         if (cutSceneState > 1)
  444.         {
  445.             curSound = PlaySoundLocal(trn_StatueJones, 1.0, 0.0, 0x0, 0);
  446.         }
  447.         WaitForSound(curSound);
  448.         
  449.         # call function that finishes up
  450.         call GiveIdolAndExit;
  451.     }
  452.  
  453.     if (cutSceneState == 2)
  454.     {
  455.         # if scene has played twice, run this shorter version as often as needed...
  456.             
  457.         # TO DO: fix CamLookOffset interp bug
  458.         
  459.         # SetExtCamLookOffset('0.0 0.04 0.014'); # look between indyAlt & turner
  460.         SetExtCamOffset('0.16 0.02 0.055'); # interp cam out to right & a tad high
  461.         Sleep(0.5);
  462.  
  463.         # Turner: "The statue, Jones?"
  464.         curSound = PlaySoundLocal(trn_StatueJones, 1.0, 0.0, 0x0, 0);
  465.         WaitForSound(curSound);
  466.  
  467.         # Indy: "Yeah, yeah, I know."
  468.         curSound = PlaySoundLocal(in_YeahIKnow, 1.0, 0.0, 0x0, 0);
  469.         
  470.         in_keyTrack1 = PlayKey(indyAlt, in_armsCrossed, 2, 0x10, 0);
  471.         PlayKey(indyAlt, in_crossArms, 4, 0x12, 1);
  472.         WaitForSound(curSound);
  473.         
  474.         # Turner: "I'm still waiting."
  475.         curSound = PlaySoundLocal(trn_StillWaiting, 1.0, 0.0, 0x0, 0);
  476.         PlayKey(turner, trn_reach, 4, 0x12, 0);
  477.         Sleep(1.0);
  478.         StopKey(indyAlt, in_keyTrack1, 0.5);
  479.         WaitForSound(curSound);
  480.  
  481.         ###
  482.         tempIdol = 1; # for testing purposes only!
  483.         ###
  484.         
  485.         SetThingFlags(indyAlt, 0x80000); # hide dupe actor indy
  486.         ClearThingFlags(player, 0x80000);
  487.         RestoreExtCam();
  488.     }
  489.             
  490.     if (cutSceneState == 1)
  491.     {
  492.         # if scene has already played once, run this...
  493.             
  494.         cutSceneState = 2; # only play this version one time
  495.  
  496.         # TO DO: fix CamLookOffset interp bug
  497.         
  498.         SetExtCamLookOffset('0.0 0.04 0.012'); # look between indyAlt & turner
  499.         SetExtCamOffset('0.18 0.02 0.055'); # interp cam out to right
  500.         Sleep(0.5);
  501.         
  502.         # Turner: "Well, where's the statue?"
  503.         curSound = PlaySoundLocal(trn_WhereStatue, 1.0, 0.0, 0x0, 0);
  504.         # gestures here
  505.         trn_keyTrack2 = PlayKey(turner, trn_foldArms, 4, 0x14, 0);
  506.         Sleep(0.5);
  507.         in_keyTrack1 = PlayKey(indyAlt, in_handsOnHips, 2, 0x10, 0);
  508.         PlayKey(indyAlt, in_handsToHips, 4, 0x12, 1);
  509.         WaitForSound(curSound);
  510.  
  511.         # Indy: "I'm working on it."
  512.         curSound = PlaySoundLocal(in_WorkOnIt, 1.0, 0.0, 0x0, 0);
  513.         WaitForSound(curSound);
  514.  
  515.         # Turner: "I'll be waiting."
  516.         curSound = PlaySoundLocal(trn_BeWaiting, 1.0, 0.0, 0x0, 0);
  517.         # gestures here
  518.         Sleep(1.0);
  519.         WaitForSound(curSound);
  520.         StopKey(indyAlt, in_keyTrack1, 0.5);
  521.         StopKey(turner, trn_keyTrack2, 0.5);
  522.         Sleep(0.5);
  523.         
  524.         SetThingFlags(indyAlt, 0x80000);
  525.         ClearThingFlags(player, 0x80000);
  526.         RestoreExtCam();        
  527.     }
  528.     
  529.     EndCutScene();
  530.  
  531.     return;
  532.  
  533. # -------------------------------------------------------------------
  534.  
  535. GiveIdolAndExit:
  536.  
  537.     cutSceneState = 3; # we're finishing scene now
  538.     
  539.     # Show Indy on his mark...
  540.     DestroyThing(indyAlt); # don't need dupe no more
  541.     SetThingFlags(player, 0x80000); # hide player
  542.     ClearThingFlags(indy, 0x80010); # our first actor is visible again
  543.     Sleep(0.01);
  544.  
  545.     # Cut to close-up of Indy...
  546.     RestoreExtCam();
  547.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  548.     SetCameraPosInterp(2, 0); # kill dolly mode
  549.     SetCameraFocus(2, cam_3);
  550.     SetCameraSecondaryFocus(2, c_t3);
  551.     SetCurrentCamera(2);
  552.     SetCameraFOV(40, 0, 0.0);
  553.     Sleep(0.01);
  554.     AISetLookThing(indy, turner);
  555.     AISetLookThing(turner, indy);
  556.     
  557.     # Indy: "Will this do?"
  558.     curSound = PlaySoundLocal(in_ThisDo, 1.0, 0.0, 0x0, 0);
  559.  
  560.     # Lift statue into view...
  561.     SetThingMesh(indy, 15, inhand_mdkstat, 0);
  562.     in_keyTrack1 = PlayKey(indy, in_showMarduk, 2, 0x14, 0);
  563.     WaitForSound(curSound);
  564.     Sleep(0.5);
  565.  
  566.     # Cut to side-view of Indy and Turner
  567.     SetCameraFocus(2, cam_10);
  568.     SetCameraSecondaryFocus(2, c_t10);
  569.     SetCurrentCamera(2);
  570.     SetCameraFOV(28, 0, 0.0);
  571.  
  572.     # Turner: "It just might!  Anything else?"
  573.     curSound = PlaySoundLocal(trn_JustMight, 1.0, 0.0, 0x0, 0);
  574.  
  575.     # Dolly into reverse angle on Indy over Turner's shoulder...
  576.     SetCameraInterpSpeed(2, 18.5); # speed is actually time
  577.     SetCameraLookInterp(2, 1); # enable pan & tilt mode
  578.     SetCameraPosInterp(2, 1); # enable dolly mode
  579.     Sleep(0.01);
  580.     SetCameraFocus(2, cam_6);
  581.     SetCameraSecondaryFocus(2, c_t6);
  582.     SetCameraFOV(45, 1, 7.0); # first we widen the angle...
  583.  
  584.     # Give & take Marduk statuette...
  585.     StopKey(indy, in_keyTrack1, 0.0);
  586.     PlayKey(indy, in_giveMarduk, 4, 0x12, 0);
  587.     SetThingMesh(turner, 5, tuhand_mdkstat, 0);
  588.     SetThingMesh(indy, 15, tu_hand, 0);
  589.     PlayKey(turner, trn_getMarduk, 4, 0x12, 1);
  590.     PlayKey(turner, trn_stowMarduk, 4, 0x12, 0);
  591.     StopKey(indy, in_keyTrack1, 0.5); # Indy relaxes from giving statue
  592.     Sleep(1.5);
  593.     SetThingMesh(turner, 5, tu_hand, 0);
  594.     Sleep(0.5);
  595.     
  596.     # Lose statue from inventory...
  597.     SetInv(player, mardukIdol, 0.00);
  598.  
  599.     # Indy: "According to the inscription..."
  600.     WaitForSound(curSound);
  601.     # curSound = PlaySoundLocal(in_TowerExpo, 1.0, 0.0, 0x0, 0);
  602.     curSound = PlayVoice(indy, in_TowerExpo, 1.0, 0);
  603.     PlayKey(indy, in_inscription, 4, 0x12, 1);
  604.     SetCameraFOV(34, 1, 8.3); # ...and then we tighten up again
  605.     WaitForSound(curSound);
  606.  
  607.     # Turner: "Taking them...where?"
  608.     curSound = PlaySoundLocal(trn_DisciplesWhere, 1.0, 0.0, 0x0, 0);
  609.     PlayKey(turner, trn_leftUp, 4, 0x12, 1);
  610.     WaitForSound(curSound);
  611.  
  612.     # Indy: "Not sure, except...Urgon...heavenly mountains..."
  613.     # curSound = PlaySoundLocal(in_NotSure, 1.0, 0.0, 0x0, 0);
  614.     curSound = PlayVoice(indy, in_NotSure, 1.0, 0);
  615.     PlayKey(indy, in_urgon, 4, 0x12, 1);
  616.     WaitForSound(curSound);
  617.  
  618.     # Turner: "That's not much help."
  619.     curSound = PlaySoundLocal(trn_NotMuch, 1.0, 0.0, 0x0, 0);
  620.     PlayKey(turner, trn_nothelp, 4, 0x12, 0);
  621.     WaitForSound(curSound);
  622.  
  623.     # Cut to Indy...
  624.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  625.     SetCameraPosInterp(2, 0); # kill dolly mode
  626.     Sleep(0.01);
  627.     SetCameraFocus(2, cam_5);
  628.     SetCameraSecondaryFocus(2, c_t5);
  629.     SetCameraFOV(42, 0, 0.0); # was 35
  630.     SetThingFlags(turner, 0x10); # invisible
  631.     
  632.     # Indy: "Might be enough...Tian Shan..."
  633.     # curSound = PlaySoundLocal(in_Enough, 1.0, 0.0, 0x0, 0);
  634.     curSound = PlayVoice(indy, in_Enough, 1.0, 0);
  635.     PlayKey(indy, in_heavenly, 4, 0x12, 1);
  636.     WaitForSound(curSound);
  637.  
  638.     # Cut to Turner over Indy's shoulder...
  639.     SetCameraFocus(2, cam_7);
  640.     SetCameraSecondaryFocus(2, c_t7);
  641.     SetCameraFOV(36, 0, 0.0);
  642.     ClearThingFlags(turner, 0x10); # visible again
  643.     
  644.     # Turner: "Kazakstan?  ...Soviet territory."
  645.     curSound = PlaySoundLocal(trn_KazakSoviet, 1.0, 0.0, 0x0, 0);
  646.     PlayKey(turner, trn_sovietland, 4, 0x12, 1);
  647.     WaitForSound(curSound);
  648.     
  649.     # Indy: "Maybe I won't show the border guards..."
  650.     curSound = PlaySoundLocal(in_NoPassport, 1.0, 0.0, 0x0, 0);
  651.     PlayKey(indy, in_ArmsOut, 4, 0x12, 0);
  652.     Sleep(0.4);
  653.  
  654.     # Dolly and boom to wider shot...
  655.     SetCameraInterpSpeed(2, 2.2); # speed is actually time (was 3.0)
  656.     SetCameraLookInterp(2, 1); # enable pan & tilt
  657.     SetCameraPosInterp(2, 1); # enable dolly
  658.     Sleep(0.01);
  659.     SetCameraFocus(2, cam_9);
  660.     SetCameraSecondaryFocus(2, c_t9);
  661.     SetCameraFOV(75, 1, 2.2); # (was 3.0)
  662.     WaitForSound(curSound);
  663.  
  664.     # Turner: "Okay, buddy.  It's your funeral."
  665.     curSound = PlaySoundLocal(trn_YourFuneral, 1.0, 0.0, 0x0, 0);    
  666.  
  667.     # Turner moves aside...
  668.     StopKey(turner, trn_keyTrack1, 0.0); # kill low-priority hands-on-hips anim
  669.     trn_keyTrack1 = PlayKey(turner, trn_beMyGuest, 4, 0x14, 0);
  670.     Sleep(2.0);
  671.     AISetLookThing(turner, indy);
  672.     SetCollideType(turner, 0); # indy must not be impeded by t's collision sphere
  673.     WaitForSound(curSound);
  674.     
  675.     # Ending Theme
  676.     PlaySoundLocal(itsawrap, 1, 0, 0, 0);
  677.  
  678.     # Prep camera to follow jeep...
  679.     SetCameraInterpSpeed(2, 6.0); # speed is actually time
  680.     
  681.     SetCameraFocus(2, cam_8);
  682.     SetCameraSecondaryFocus(2, c_t8);
  683.     SetCameraFOV(80, 1, 3.0);
  684.     
  685.     # Put Indy into the jeep...
  686.     AISetLookThing(indy, jeep);
  687.     AISetMoveThing(indy, in_mark_3, 0);
  688.     AIWaitForStop(indy);
  689.     SetThingMaxRotVel(indy, in_rotRate); # superstition?
  690.     DestroyThing(jeep);
  691.     DestroyThing(indy);
  692.    
  693.     # Make a jeep with Indy in it...
  694.     jeep_actor = CreateThing(jeep_actor_tpl, jeep);
  695.     CaptureThing(jeep_actor);
  696.     ClearThingFlags(jeep_actor, 0x80000);
  697.     AttachThingToThing(c_t8, jeep_actor); # so cam will follow
  698.     PlayKey(jeep_actor, jpa_mountJeep, 4, 0x12, 1); # sit our hero down
  699.     Sleep(0.5);
  700.     
  701.     jeepstart_chan=PlaySoundThing(jeep_start_wav, jeep_actor, 1, 10, 20, 0);
  702.     WaitForSound(jeepstart_chan);
  703.     
  704.     # Cut to watch Indy go brrrrmm...
  705.     jeep_rotRate = GetThingMaxRotVel(jeep_actor);
  706.     SetThingMaxRotVel(jeep_actor, 50.0); # make it resistant to turning
  707.     in_keyTrack1 = PlayKey(jeep_actor, jpa_steerL, 2, 0x04, 0);
  708.     in_jeepkey_rev = PlayKey(jeep_actor, jeep_runbackward, 2, 0x0, 0);
  709.     jeeprevrs_chan=PlaySoundThing(jeep_rev_wav, jeep_actor, 1, 10, 20, 1);
  710.     
  711.     AISetMoveSpeed(jeep_actor, 1.0);
  712.     AISetLookThing(jeep_actor, jp_lk1);
  713.     AISetMoveThing(jeep_actor, jp_t1, 0);
  714.     Sleep(0.5);
  715.     AISetMoveSpeed(jeep_actor, 1.5);
  716.     AISetLookThing(jeep_actor, jp_lk2);
  717.     AISetMoveThing(jeep_actor, jp_t2, 0);
  718.     Sleep(0.4);
  719.     AISetMoveSpeed(jeep_actor, 2.0);
  720.     AISetLookThing(jeep_actor, jp_lk3);
  721.     AISetMoveThing(jeep_actor, jp_t3, 0);
  722.     Sleep(0.4);
  723.     AISetMoveSpeed(jeep_actor, 1.5);
  724.     AISetMoveThing(jeep_actor, jp_t4, 0);
  725.     Sleep(0.4);
  726.     AISetMoveSpeed(jeep_actor, 1.0);
  727.     AISetLookThing(jeep_actor, jp_lk4);
  728.     AISetMoveThing(jeep_actor, jp_t5, 0);
  729.     Sleep(1.0);
  730.     StopKey(jeep_actor, in_keyTrack1, 0.5);
  731.     StopKey(jeep_actor, in_jeepkey_rev, 0.1);
  732.     Sleep(0.5);
  733.     
  734.     # TO DO: get the wheels to spin--backwards up to here, then forward
  735.     StopSound(jeeprevrs_chan, 0);
  736.     jeepshift_chan=PlaySoundThing(jeep_actor, jeep_shift_wav, 1, 10, 20, 0);
  737.     WaitForSound(jeepshift_chan);
  738.     in_keyTrack1 = PlayKey(jeep_actor, jeep_runforward, 2, 0x00, 0);
  739.     PlaySoundThing(jeep_actor, jeep_fwd_wav, 1, 10, 20, 1);
  740.     AISetMoveSpeed(jeep_actor, 2.0);
  741.     AISetLookThing(jeep_actor, jp_t6);
  742.     AISetMoveThing(jeep_actor, jp_t6, 0);
  743.     Sleep(0.6);
  744.  
  745.     # Prep Turner to move again...
  746.     StopKey(turner, trn_keyTrack1, 0.0);
  747.     SetThingMass(turner, turnerMass); # back to normal
  748.     SetCollideType(turner, turnerCollType);
  749.     SetThingCollideSize(turner, turnerCollSize);
  750.     AISetMoveSpeed(turner, 1.0);
  751.     AISetLookThing(turner, jp_lk3);
  752.     Sleep(0.01);
  753.     AISetMoveSpeed(jeep_actor, 3.0);
  754.     Sleep(1.0);
  755.     
  756.     # Walk Turner into the shot...
  757.     AISetMoveThing(turner, jp_lk3, 0);
  758.     Sleep(0.5);
  759.  
  760.     AISetMoveSpeed(jeep_actor, 4.0);
  761.     Sleep(2.0);
  762.     AIWaitForStop(turner);
  763.     Sleep(0.5);
  764.     AttachThingToThing(fadeplane, cam_8);
  765.     ThingFadeAnim(fadeplane, 0, 1, 2, 0);
  766.  
  767.     # TO DO:  stop Turner twitching as he ends walk...
  768.     trn_keyTrack1 = PlayKey(turner, trn_handships, 2, 0x0, 0);
  769.     PlayKey(turner, trn_handstohips, 4, 0x12, 1);
  770.     Sleep(4.0);
  771.     
  772.     # Final clean up...
  773.     
  774.     # Default actors (too bad we don't have a command for this)...
  775.     SetThingMaxRotVel(turner, trn_rotRate);
  776.     SetThingMaxRotVel(jeep_actor, jeep_rotRate);
  777.     
  778.     # Kill any lingering animations...
  779.     StopKey(jeep_actor, in_keyTrack1, 0.0);
  780.     StopKey(turner, trn_keyTrack1, 0.0);
  781.     
  782.     # Fix up the camera...
  783.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  784.     SetCameraPosInterp(2, 0); # kill dolly mode
  785.     SetCurrentCamera(curCam);
  786.     ResetCameraFOV(0, 0.0);
  787.     RestoreExtCam(); 
  788.     
  789.     # TO DO: end the level right now!
  790.     
  791.     JonesEndLevel();
  792.     
  793.  
  794.     # Restore player control... (temp, since Babylon chapter is now complete!)
  795.     # ClearThingFlags(player, 0x80000); # player active
  796.    
  797.     return;
  798.  
  799. # -------------------------------------------------------------------
  800.  
  801. callback:
  802.     return;
  803.  
  804. # -------------------------------------------------------------------
  805.  
  806. shutdown:
  807.     return;
  808.  
  809. # -------------------------------------------------------------------
  810.  
  811. timer:
  812.     return;
  813.     
  814. # -------------------------------------------------------------------
  815.  
  816. end
  817.